home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-15 | 1.2 KB | 38 lines | [TEXT/ALFA] |
- # (WTP 7/30/95) Slightly improved 'sendURL'.
- # By accepting a text arg, this can now be used to make sendURL
- # hypertext links (useful for "mailto" links in documentation, f'rinstance)
- #===============================================================================
- set htmlEventSuiteIDs(MOSS) {WWW!}
- proc sendUrl {{text {}}} {
- if {$text == {}} { set text [getSelect] }
- if {[string length $text] == 0} { return }
-
- global htmlEventSuiteIDs browserSig
-
- if {[catch {launchBackApplSigs {MOSS} browserSig}]} {
- getApplSig "Please locate your web browser:" browserSig
- }
- set name [file tail [launchBackAppl $browserSig]]
-
- if {![info exists htmlEventSuiteIDs($browserSig)]} {
- alertnote "Can't send URLs to this HTML browser"
- return
- }
- set suite $htmlEventSuiteIDs($browserSig)
-
- AEBuild "'${browserSig}'" $suite {OURL} {----} "メ$textモ"
- switchTo $name
- }
-
-
- proc expandURL {} {
- set pos [getPos]
- set beg [lineStart $pos]
- if {[string length [set whe [search -s -n -f 1 -r 1 -i 1 -m 0 -l [nextLineStart $pos] {[a-zA-Z0-9]+://[a-zA-Z/._0-9~-]+} $beg]]]} {
- if {($pos >= [lindex $whe 0]) && ($pos < [lindex $whe 1])} {
- eval select $whe
- return $whe
- }
- }
- }
-